<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="dao.*" %>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="TagGroup" prefix="mytag"%>
<!doctype html>
<html lang="zh-CN">
<style>
  .button1 {

            -webkit-transition-duration: 0.4s;
            transition-duration: 0.4s;
            padding: 12px 24px;
            text-align: center;
            background-color: white;
            border: 2px solid #4CAF50;
            border-radius:5px;
            position: relative;
            
        }
        .button2 {
            padding: 10px 20px;
            text-align: center;
            background-color: white;
            border: 2px solid #4CAF50;
            border-radius:5px;
            position: relative;
            
        }
        .button1:hover {
            background-color: #4CAF50;
        }
.excerptqzk{clear:both;border:1px solid #EAEAEA;padding:10px 10px 10px 10px;overflow:hidden;background-color:#fff;margin-bottom:-1px;}
</style>
<head >
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人主页</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/nprogress.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="apple-touch-icon-precomposed" href="images/icon.png">
<link rel="shortcut icon" href="images/favicon.ico">
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/nprogress.js"></script>
<script src="js/jquery.lazyload.min.js"></script>
</head>
<body class="user-select">
 <mytag:userPageHeaderTag/> 
	<body>
	<center> <a href="ModifyPassword.jsp" >修改密码</a> </center>
	<center> <a href="ChangeInformation.jsp" >修改个人信息</a> </center>
		<div class="excerpt-minic excerpt-minic-index" style="text-align:center;width:70%;height:300px; margin:0 auto 20px auto">
			
			<c:choose>
				<c:when test="${user.user_sex==0}">
					<img src="images//woman.jpg" style="width: 150px;height:150px; margin:auto auto auto auto" />
					<h2>${user.user_name}</h2>
					<a href="MymessageServlet?"> <button type="button" class = "button1">留言</button></a>
				</c:when>
				<c:when test="${user.user_sex==1}">
					<img src="images//man.jpg" style="width: 150px;height:150px; margin:auto auto auto auto" />
					<h2>${user.user_name}</h2>
					<a href="MymessageServlet?"> <button type="button" class = "button1">留言</button></a>
				</c:when> 
			</c:choose>
			<!-- 如果session 有用户的id，用上面那段就ok-->	
		</div> 
		
		<div class="excerpt-minic excerpt-minic-index" style="width:70%;height:auto; margin:0 auto 20px auto">
			<div class="content-box-large">
  				<div class="panel-body" style="margin:0 0 0 0">
					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>No.</th>
								<th>帖子列表</th>
								<th>操作</th>
							</tr>
						</thead>
						<!-- ÁÐ±íµÄÊä³ö -->
						<tbody>
                            <c:forEach var="art" items="${articles}" varStatus="status">
                            		<tr><td>${status.index+1}</td>
                            			<td>
		                            		<article class="excerptqzk" style="position:relative; z-index:66;" ><!-- 一个标签具体的一个列 -->
	                                            <a href="ShowTieServlet?article_id=${art.article_id}">
	                                                <p style="font-size:20px;margin:0px 0px 6px 0px">
	                                                    <span style="color:red">${art.article_user_istop eq 1?"[置顶]":""}
	                                                    </span>${art.article_title}
	                                                </p>
	                                            </a>
	                                            <a class="comment"  title="作者" target="_blank" style="color:rgb(26, 25, 25)"><i class="glyphicon glyphicon-user"></i>${UserDAO.getInstance().get(art.user_id).user_name}</a>
	                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                                            <time class="time"><i class="glyphicon glyphicon-time"></i> ${art.article_lastchangetime}</time>
	                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     
	                                            <span class="views" title="浏览量"><i class="glyphicon glyphicon-eye-open"></i> ${art.article_click_num}</span> 
	                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                                            <i class="glyphicon glyphicon-comment"></i> ${art.article_comment_num}
	                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                                            <i class="glyphicon glyphicon-tags"></i>&nbsp;&nbsp;类别 : ${ThemeDAO.getInstance().get_theme_name(art.theme_id)}
	                                        </article>
                                         </td>
                                         <td>
                                         	<c:choose>
												<c:when test="${art.article_user_istop==1}">
													<div class="btn-group">
                                         				<a href="ManageArticleServlet?type=0&value=2&id=${art.article_id}" class="btn btn-warning">取消顶置</a>  <!-- 这个按钮要用if标签 -->
                                         				<a href="BeforeModityArticleServlet?article_id=${art.article_id}" class="btn btn-success">编辑</a>                                       				
                                         				<a href="ManageArticleServlet?type=2&id=${art.article_id}" class="btn btn-danger" onClick="delcfm()">删除</a>
                                         			</div>
												</c:when>
												<c:when test="${art.article_user_istop==0}">
													<div class="btn-group">
                                         				<a href="ManageArticleServlet?type=0&value=3&id=${art.article_id}" class="btn btn-info">顶置帖子</a>  <!-- 这个按钮要用if标签 -->
                                         				<a href="BeforeModityArticleServlet?article_id=${art.article_id}" class="btn btn-success">编辑</a> 
                                         				<a href="ManageArticleServlet?type=2&id=${art.article_id}" class="btn btn-danger" onClick="delcfm()">删除</a>
                                         			</div>
												</c:when>
											</c:choose>                	
                                         </td>
                                      </tr>
                                      
                            </c:forEach>

						</tbody>
					</table>
  				</div>
  			</div> 
		</div> 
		
	</body>



<footer class="footer">
<div class="container">
<p>Copyright &copy; 企业论坛  Powered by YNWA team!</p>
</div>
<div id="gotop"><a class="gotop"></a></div>
</footer>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.ias.js"></script>
<script src="js/scripts.js"></script>
<script src="https://code.jquery.com/jquery.js"></script>
<!-- jQuery UI -->
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="bootstrap/js/bootstrap.min.js"></script>

<script src="vendors/datatables/js/jquery.dataTables.min.js"></script>

<script src="vendors/datatables/dataTables.bootstrap.js"></script>

<script src="js/custom.js"></script>
<script src="js/tables.js"></script>
 	<script type="text/javascript">
    function delcfm() {
        if (!confirm("确定要删除该帖子吗？")) {
            window.event.returnValue = false;
        }
    }
	</script>
</body>
</html>
